﻿<UserControl x:Class="YALV.View.Components.FilterView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Components="clr-namespace:YALV.View.Components" mc:Ignorable="d" 
             d:DesignHeight="150" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Components:AutoCompleteTextBox x:Name="textBox_Filter" Grid.Column="0" Margin="5" Height="23" MinWidth="225" Width="Auto" DelayTime="500" Threshold="2" AutoCompleteList="{Binding Path=FilterViewModel.AutoCompleteList, RelativeSource={RelativeSource Mode= TemplatedParent}}" />   
        <Grid Grid.Column="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Button Click="ButtonBase_OnClick" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="Auto">
                <Image Source="/YALV;component/Resources/Icons/confirm.png" Width="16" Height="16" />
            </Button>
            <Button Click="ButtonReset_OnClick" Command="{Binding CommandResetFilter}" Grid.Column="1" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="Auto">
                <Image Source="/YALV;component/Resources/Icons/delete.png" Width="16" Height="16" />
            </Button>
        </Grid>
        <StackPanel Grid.Column="0" Grid.Row="1">
            <Label>Queries :</Label>
            <ItemsControl Name="ListQueries"
                HorizontalAlignment="Left" 
                VerticalAlignment="Top"
                ItemsSource="{Binding Path=FilterViewModel.Queries}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Components:FilterQueryView/>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </StackPanel>
    </Grid>
</UserControl>
